﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Com.CMS263.PO;
using Com.CMS263.Util;
using Com.CMS263.BLL;
using System.IO;

namespace Com.CMS263.Web.manage.ManageSite
{
    public partial class ModSiteInfo : System.Web.UI.Page
    {
        SiteInfoBLL sibll = new SiteInfoBLL();
        public SiteInfo si = new SiteInfo();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                si = sibll.GetSiteInfo();
                btnSave.Attributes.Add("onclick", "return check()");
            }

        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            si = sibll.GetSiteInfo();
            string title = StringUtil.checkStr(Request["txtTitle"]);
            string url = StringUtil.checkStr(Request["txtUrl"]);
            string icp = StringUtil.checkStr(Request["txtIcp"]);
            string description = StringUtil.checkStr(Request["SeoDescription"]);
            string keyword = StringUtil.checkStr(Request["SeoKeyword"]);
            string copy = Request["txtCopyRight"];
            string link = Request["txtLink"];
            string lookCount = StringUtil.checkStr(Request["lookCount"]);
            si.AccountNum = Convert.ToInt32(lookCount);
            si.CopyRight = copy;
            si.Icp = icp;
            si.Description = description;
            si.Keyword = keyword;
            si.Link = link;
            si.SiteName = title;
            si.SiteUrl = url;
            sibll.entity = si;
            sibll.UpDate();
            StringUtil.Alert("修改成功", "ModSiteInfo.aspx");
        }

        protected void CheckBox2_CheckedChanged(object sender, EventArgs e)
        {

        }

    }

}
